% import time as t
% start_time = t.time()
% title = 'Your Pastes'
% scripts = tuple(('sorttable.js',))
% include(top)
<!-- TODO: Make this page responsive for mobile -->
<div class="content center">
	<h1>{{title}}</h1>
	<p>Logged in as <b>{{username}}</b>. <a href="/user/changepass">Change password?</a></p>
	
% if len(pastes):
	<table class="pure-table sortable">
		<thead>
		<tr><th>Key</th><th>Title</th><th>Views</th><th>Filename</th><th>Filetype</th><th>Uploaded</th><th>Expires</th><th>Delete</th></tr>
		</thead>
		<tbody>
% for paste, contents in pastes.items():
			<tr>
				<td><a href="/p/{{paste}}">{{paste}}</a></td>
				<td>{{contents['title']}}</td>
				<td>{{contents['views']}}</td>
				<td>{{contents['filename']}}</td>
				<td>{{contents['filetype']}}</td>
				<td sorttable_customkey="{{contents['time']}}">{{!t.strftime("%B %d, %Y at %I:%M %p", t.gmtime(contents['time']))}}</td>
% expires = int(contents['expires'])
% if expires:
				<td sorttable_customkey="{{expires}}">{{!t.strftime("%B %d, %Y at %I:%M %p", t.gmtime(expires))}}</td>
% else:
				<td sorttable_customkey="{{expires}}">Never</td>
% end  # (if)
				<td><a href="/delete/{{paste}}">Delete</a></td>
			</tr>
% end  # (for)
		</tbody>
	</table>
	
% else:
		<p>You have no pastes. Want to <a href="/upload">upload one?</a></p>
% end  # (if)
	
</div>

% include(bottom)
% current_time = t.time()
% time_gen = t.strftime("%D %H:%M:%S", t.localtime(int(current_time)))
% timediff = current_time - start_time
<!-- Generated on {{time_gen}} GMT in {{timediff}} seconds. -->
